<template>
	<view>
		<address-add :addressId="id" :type="type" @edit="edit" @add="add" @back="back"></address-add>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: 0,
				type: 'add'
			};
		},
		onLoad(opt) {
			console.log(opt)
			if (opt.id) {
				this.id = opt.id
			}
			if(opt.edit){
				this.type = 'edit'
			}
		},
		methods: {
			edit(){
				uni.redirectTo({
					url: '/pages/my/addressSet/addressSet'
				})
			},
			add(){
				uni.redirectTo({
					url: '/pages/my/addressSet/addressSet'
				})
			},
			back(){
				uni.navigateBack()
			}
		}
	};
</script>

<style lang="scss" scoped>
	
</style>
